<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el" %>
<%@ taglib uri="ford-arg/tags" prefix="ft" %>

<SCRIPT language="JavaScript" 
        src="scripts/CalendarPopup.js">
</SCRIPT>
<script language="JavaScript" src="./scripts/popups.js"></script>
<script type="text/javascript" language="javascript"
	src="./scripts/ajaxSearch.js">
</script>


<script language="javascript">
	var cal = new CalendarPopup(); 
	cal.showNavigationDropdowns();
	cal.setMonthNames('<bean:message key="label.month.january"/>',
						'<bean:message key="label.month.february"/>',
						'<bean:message key="label.month.march"/>',
						'<bean:message key="label.month.april"/>',
						'<bean:message key="label.month.may"/>',
						'<bean:message key="label.month.june"/>',
						'<bean:message key="label.month.july"/>',
						'<bean:message key="label.month.august"/>',
						'<bean:message key="label.month.september"/>',
						'<bean:message key="label.month.october"/>',
						'<bean:message key="label.month.november"/>',
						'<bean:message key="label.month.december"/>');
	cal.setDayHeaders('<bean:message key="label.day.sunday.capital"/>',
						'<bean:message key="label.day.monday.capital"/>',
						'<bean:message key="label.day.tuesday.capital"/>',
						'<bean:message key="label.day.wednesday.capital"/>',
						'<bean:message key="label.day.thursday.capital"/>',
						'<bean:message key="label.day.friday.capital"/>',
						'<bean:message key="label.day.saturday.capital"/>');
	cal.setTodayText('<bean:message key="label.today"/>');
	
	function findParts() {
		document.PartsWithoutCostStructReportForm.action = "PartsWithoutCostStrActionFind.do";
		document.PartsWithoutCostStructReportForm.section.value = "find";
		document.PartsWithoutCostStructReportForm.submit();
	}
	
</script>
	
<table>
	<tr>
		<td colspan="2"><h2><bean:message key="partWithoutCostStr.label.title"/></h2></td>
	</tr>
</table>
<br/>
<html:form action="/PartsWithoutCostStrActionInit">
<html:hidden property="section" />

	<%-- Mantiene el numero de pagina despues del submit --%>
	<ft:saveActivePageNumber/>
	
	<bean:define id="nameTitle">
		<bean:message key="part.label.tableHeader.description" />
	</bean:define>
	<bean:define id="partTitle">
		<bean:message key="part.label.tableHeader.part" />
	</bean:define>
	<bean:define id="unitTitle">
		<bean:message key="part.label.tableHeader.unitsMesure" />
	</bean:define>
	<bean:define id="lowComTitle">
		<bean:message key="part.label.tableHeader.lowCom" />
	</bean:define>
	<bean:define id="fechaInTitle">
		<bean:message key="part.label.tableHeader.fechaIn" />
	</bean:define>
	<bean:define id="fechaOutTitle">
		<bean:message key="part.label.tableHeader.fechaOut" />
	</bean:define>
	<bean:define id="creationTitle">
		<bean:message key="label.created" />
	</bean:define>
	<bean:define id="modificationTitle">
		<bean:message key="label.updated" />
	</bean:define>
	<table style="width: 800px;" class="no_border">
		<tr>
			<td class="text_blue_bold align_left" colspan="1">
				<bean:message key="part.label.filter" />
			</td>
		</tr>
		<tr>
			<td class="text_blue_bold align_left">
				<bean:message key="part.label.supplier" />
			</td>
			<td>
				<html:select property="supplierClass" styleId="supplierClass">
					<html:option value="-1"><bean:message key="label.allOption" /></html:option>
					<html:options collection="partClassColl"
								  property="value"
								  labelProperty="label" />
				</html:select>
			</td>
			<td class="align_left">
				<html:text styleId="supplierCode" property="supplierCode" maxlength="6" size="9"/>
				<html:button property="suppName" onclick="searchNameSupplier('supplierName','supplierCode','supplierClass');" styleClass="button_small">...</html:button>
				<html:button property="findSupp" onclick="findSupplierPopup('supplierClass','supplierCode');" styleClass="button_small" style="width:20px;">?</html:button>
			</td>
			<td>
				<div id="supplierName" title="supplierName" style="display: inline; align: left"></div>
			</td>
		</tr>
		<tr>
			<td class="text_blue_bold align_left">
				<bean:message key="part.label" />
			</td>
			<td>
				<html:select property="partClass">
					<html:option value="-1"><bean:message key="label.allOption" /></html:option>
					<html:options collection="partClassColl"
								  property="value"
								  labelProperty="label" />
				</html:select>
			</td>
			<td class="align_left" colspan="3">
				<html:text styleId="prefix" property="prefix" maxlength="10" size="9"/>&nbsp;
				<html:text styleId="base" property="base" maxlength="10" size="9"/>&nbsp;
				<html:text styleId="suffix" property="suffix" maxlength="10" size="9"/>&nbsp;
			</td>
		</tr>
		<tr>
			<td class="text_blue_bold align_left" colspan="1">
				<bean:message key="part.label.dateInBetween" />
			</td>
			<td class="text_blue_bold align_left"  colspan="3">
			    <html:text styleId="dateInMin" property="dateInMin" maxlength="10" size="10"/><A name="dateInMinAnchor"> </A><html:button property="calendar" onclick="cal.select(document.PartsWithoutCostStructReportForm.dateInMin,'dateInMinAnchor','dd/MM/yyyy'); return false;" styleClass="button_small">...</html:button>
				<bean:message key="label.and" />
				<html:text styleId="dateInMax" property="dateInMax" maxlength="10" size="10"/><A name="dateInMaxAnchor"> </A><html:button property="calendar" onclick="cal.select(document.PartsWithoutCostStructReportForm.dateInMax,'dateInMaxAnchor','dd/MM/yyyy'); return false;" styleClass="button_small">...</html:button>
			</td>
			<td class="text_blue_bold align_left" colspan="1">
				<bean:message key="part.label.dateOutBetween" />
			</td>
			<td class="text_blue_bold align_left"  colspan="3">
				<html:text styleId="dateOutMin" property="dateOutMin" maxlength="10" size="10"/><A name="dateOutMinAnchor"> </A><html:button property="calendar" onclick="cal.select(document.PartsWithoutCostStructReportForm.dateOutMin,'dateOutMinAnchor','dd/MM/yyyy'); return false;" styleClass="button_small">...</html:button>
				<bean:message key="label.and" />
				<html:text styleId="dateOutMax" property="dateOutMax" maxlength="10" size="10"/><A name="dateOutMaxAnchor"> </A><html:button property="calendar" onclick="cal.select(document.PartsWithoutCostStructReportForm.dateOutMax,'dateOutMaxAnchor','dd/MM/yyyy'); return false;" styleClass="button_small">...</html:button>				
			</td>
			<td/>
		</tr>
		<tr>
			<td class="text_blue_bold align_left" colspan="1">
				<bean:message key="part.label.tableHeader.commodity" />
			</td>
			<td class="text_blue_bold align_left" colspan="3">
				<html:select property="commodity">
					<html:option value="-1"><bean:message key="label.allOption" /></html:option>
					<html:options collection="commColl"
								  property="eesp02CommodityNumberK"
								  labelProperty="eesp02CommodityNameN" />
				</html:select>
			</td>
			<td class="text_blue_bold align_left" colspan="1">
				<bean:message key="costStructure.def.label.vehicleLine" />
			</td>
			<td class="text_blue_bold align_left" colspan="2">
				<html:select property="vehicleLine">
					<html:option value="-1"><bean:message key="label.allOption" /></html:option>
					<html:options collection="lineColl"
								  property="cas012VehicleCodeC"
								  labelProperty="cas012VehicleCodeC" />
				</html:select>
			</td>
			<td class="align_right">			
				<input type="button" value="<bean:message key="label.clean"/>" class="button_small" onclick="clearFindFilds();" />
			</td>
			<td class="align_left">
				<html:button property="find" onclick="findParts();" styleClass="button_small"><bean:message key="label.find" /></html:button>
			</td>
		</tr>		
	</table>
	<br/>
	<table class="no_border" style="width: 900px;">
		<tr>
			<td>
				<display-el:table 	class="table1" style="width: 850px;" cellpadding="5" uid="part"
									 pagesize="15" name="sessionScope.PartsWithoutCostStructReportForm.parts" 
									excludedParams="*" requestURI="PartActionPaginate.do" >
					<display-el:column title="${partTitle}" style="width: 18%;" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
						<bean:write name="part" property="eesp01PartClassCodeC"/>
						<bean:write name="part" property="eesp01PartPrefixCodeC"/>&minus;<bean:write name="part" property="eesp01PartBaseCodeC"/>&minus;<bean:write name="part" property="eesp01PartSuffixCodeC"/>
					</display-el:column>
					<display-el:column title="${nameTitle}" property="eesp01PartDescriptionX" style="width: 15%;" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right"/>
					<display-el:column title="${unitTitle}" property="eesp01PartUnitmeasureCodeC" style="width: 6%;" class="cell1 text_bold border1_right border1_top align_center" headerClass="header border_right"/>
					<display-el:column title="${lowComTitle}" style="width: 6%;" class="cell1 text_bold border1_right border1_top align_center" headerClass="header border_right">
						<logic:empty name="part" property="eesp01PartCommodLowCodeC">-</logic:empty>
						<logic:notEmpty name="part" property="eesp01PartCommodLowCodeC">
							<bean:write name="part" property="eesp01PartCommodLowCodeC"/>
						</logic:notEmpty>
					</display-el:column>
					<display-el:column title="${fechaInTitle}" property="eesp01PartInDateY" decorator="ar.com.ford.it.fullEconomics.view.displaytag.DateDecorator"  style="width: 10%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column title="${fechaOutTitle}" property="eesp01PartOutDateY" decorator="ar.com.ford.it.fullEconomics.view.displaytag.DateDecorator"  style="width: 10%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column title="${creationTitle}" style="width: 12%;"  decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" >
						<bean:write name="part" property="eesp01CreateUserC"/><br />
						<bean:write name="part" property="eesp01CreateS"/>
					</display-el:column>
					<display-el:column title="${modificationTitle}" style="width: 12%;"  decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" >
						<bean:write name="part" property="eesp01LastUpdtUserC"/><br />
						<bean:write name="part" property="eesp01LastUpdtS"/>
					</display-el:column>
				</display-el:table>
			</td>		
		</tr>
	</table>
	<DIV ID="calDiv" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>
</html:form>